package org.jshand.cloud.controller;


import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RefreshScope
public class HealthController {


    @Value("${config.url}")
    private String url;

    // 用于健康检查的接口
    // 返回一个简单的JSON响应，表示服务是健康的
    @RequestMapping("/health")
    public String healthCheck() {
        return "{\"status\": \"UP\"}";
    }


    /**
     * http://localhost:8080/get
     * @return
     */
    @RequestMapping("/get")
    public String get() {
        return url;
    }
}
